# -*- coding: utf-8 -*-
# @Time    : 2021/12/21 9:45
# @Author  : TangDagui
# @Email   : 3297364807@qq.com
# @File    : PythonTaskTwo.py
# @Software: PyCharm

import matplotlib.pyplot as plt
import numpy as np
import pandas as ps

data = ps.read_csv("成绩.csv", encoding="gbk")

# 姓名
name = list(data['姓名'])
# 成绩
ach = list(data['成绩'])

print(ach)
# plt.rcParams['font.sans-serif'] = ['SimHei']  # 中文字体设置
# plt.xlim(50, 100)  # 设置横坐标范围
plt.hist(ach, 10, range=(50, 100))  # 生成直方图数据
plt.xlabel("成绩", fontproperties="SimHei")  # x轴标签为成绩
plt.ylabel("人数", fontproperties="SimHei")  # y轴标签为人数
plt.show()  # 显示
